<?php

$userid = get_loggedin_userid();
$device_token = get_input('device_token');

$delete_device_token_sql = "DELETE FROM users_device_info WHERE userid = $userid AND device_token = '$device_token'";

try {
	delete_data($delete_device_token_sql);
} catch(DatabaseException $dbe) {
	die(json_encode(export_result(400, array())));
}

echo json_encode(export_result(200, array('Deleted device token.')));
	
?>